package com.wutao.panzh.admin.service.Impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.panzh.entity.FoodClassification;
import com.wutao.panzh.admin.mapper.FoodClassificationMapper;
import com.wutao.panzh.service.FoodClassificationService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class FoodClassificationServiceImpl implements FoodClassificationService {

    @Autowired
    private FoodClassificationMapper foodClassificationMapper;

    @Override
    public List<FoodClassification> getAllClassIfication() {
        return foodClassificationMapper.selectAll();
    }

    @Override
    public void insertSceneryClassification(String classificationName) {
        FoodClassification foodClassification = new FoodClassification();
        foodClassification.setCategorizationInformation(classificationName);
        foodClassificationMapper.insert(foodClassification);

    }

    @Override
    public void deleteSceneryClassification(String itemId) {
        FoodClassification foodClassification = new FoodClassification();
        foodClassification.setId(Integer.parseInt(itemId));
        foodClassificationMapper.delete(foodClassification);
    }
}
